import { Component, OnDestroy, OnInit } from '@angular/core';
import { AutopartsService } from '@core/services/autoparts/autoparts.service';
import { Subscription } from 'rxjs';
import { AutopartsViewService } from '@core/services/autoparts/autoparts.view.service';


@Component({
  templateUrl: './epc-model-info.component.html',
  selector: 'epc-model-info',
  styleUrls: ['./epc-model-info.component.scss']
})
export class EpcModelInfoComponent implements OnInit, OnDestroy {

  private subscription: Subscription;
  data: any = {};

  constructor(private autopartsService: AutopartsService,
              private  autopartsViewService: AutopartsViewService) {

  }

  ngOnInit(): void {
    this.subscription = this.autopartsViewService.modelInfoChange$.subscribe((data) => {
      this.data = data;
    });
  }

  ngOnDestroy(): void {
    this.subscription.unsubscribe();
  }
}
